import router from './index';
import { isLightOS, navigateTo } from '@winner-fed/native-bridge-methods';

router.beforeEach((to, from, next) => {
  // 设置页面标题
  document.title = to.meta.title || 'H5 Demo';
  
  if (from.name && isLightOS()) {
    navigateTo({ url: `${window.location.href.split('#')[0]}#${to.fullPath}` });
  } else {
    next();
  }
});
